package com.victor.system.api.factory;

import com.victor.common.core.domain.R;
import com.victor.common.entity.system.SysHospital;
import com.victor.common.entity.system.SysThirdKey;
import com.victor.common.response.system.OrgCodeAndOrgName;
import com.victor.system.api.RemoteSysHospitalService;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

public class RemoteSysHospitalFallbackFactory implements FallbackFactory<RemoteSysHospitalService> {
    @Override
    public RemoteSysHospitalService create(Throwable cause){

        return new RemoteSysHospitalService() {

            @Override
            public R<Integer> getRuleSystemType(String source) {
                return R.fail("获取规则系统类型失败:" + cause);
            }

            @Override
            public R<SysHospital> getOrgInfoByWjw(String source) {
                return null;
            }

            @Override
            public R<String> getOrgList(String orgCode, String source) {
                return null;
            }

            @Override
            public R<String> getOrgCodeCloseStatus(String orgCode, String source) {
                return null;
            }

            @Override
            public R<List<SysThirdKey>> findList(SysThirdKey body, String source) {

                return R.fail("获取第三方私钥失败:" + cause);
            }

            @Override
            public R<Boolean> updateThirdToken(SysThirdKey body, String source) {
                return R.fail("保存第三方token失败" + cause);
            }

            @Override
            public R<SysThirdKey> getYCThirdMsg(String source) {
                return R.fail("获取第三方(医丞)信息失败" + cause);
            }

            @Override
            public R<String> getRegisterNumByOrgCode(String orgCode, String source) {
                return R.fail("获取登记号失败" + cause);
            }

            @Override
            public R<List<OrgCodeAndOrgName>> getOrgNameAndCommunity(String source) {
                return R.fail("获取机构信息失败" + cause);
            }
        };

    }
}
